<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    执行成功
    <p th:text="${num}"></p>
    <script src="/js/echarts.js"></script>

    <div id="statistic" style="width: 500px;height:500px;">

    </div>
    <script>
        var statistics =  document.getElementById('statistic');
        var num = document.querySelector('p').innerHTML;
        var myChart = echarts.init(statistics);
        console.log(num);
        myChart.setOption({
            series : [
                {
                    name: '访问来源',
                    type: 'pie',    // 设置图表类型为饼图
                    radius: '45%',  // 饼图的半径，外半径为可视区尺寸（容器高宽中较小一项）的 55% 长度。
                    data:[          // 数据数组，name 为数据项名称，value 为数据项值
                        {value:5, name:'视频广告'},
                        {value:5, name:'联盟广告'},
                        {value:num, name:'邮件营销 '+'('+num+'人)'}
                    ]
                }
            ]
        })
    </script>
<a href="testDemo"></a>
</body>
</html>